<extend name="Layout/page_popup" />
<block name="content">
	<input type="hidden" name="ajax" id="ajax" value="1">
	<select name="dept_list" id="dept_list" class="display-none">
		{:fill_option($dept_list)}
	</select>
	{:W('PageHeader/popup',array('name'=>'添加员工','search'=>'S'))}
	<div class="row">
		<div class="col-xs-12">
			<form id="form_data" name="form_data" method="post" class="form-horizontal">
				<input type="hidden" name="opmode" id="opmode" value="add">
				<table class="table table-bordered" >
					<tr>
						<th class="col-10">
						<nobr>
							员工编号*
						</nobr></th>
						<td class="col-20">
						<input class="form-control" type="text" id="emp_no" name="emp_no"  check="require" msg="请输入员工编号">
						</td>
						<th  class="col-10">姓名*</th>
						<td class="col-20">
						<input  class="form-control" type="text" id="name" name="name" class="input-sm" check="require" msg="请输入姓名">
						</td>
					</tr>
					<tr>
						<th>性别</th>
						<td >
						<select name="sex" id="sex" class="form-control col-10">
							<option  value="male">男</option>
							<option value="female">女</option>
						</select></td>
						<th>生日</th>
						<td >
						<input data-date-format="yyyy-mm-dd" type="text" id="birthday" name="birthday" readonly="readonly" class="input-date form-control">
						</td>
					</tr>
					<tr>
						<th>部门*</th>
						<td class="col-20">
						<div class="input-group ">
							<input class="form-control" name="dept_name"  id="dept_name" type="text" msg="请选择部门" check="require" readonly="readonly" />
							<input name="dept_id" id="dept_id" type="hidden" msg="请选择部门" check="require" />
							<div class="input-group-btn">
								<a class="btn btn-sm btn-primary" onclick="select_dept();" > <i class="fa fa-search" ></i> </a>
							</div>
						</div></td>
						<th class="col-10">职位*</th>
						<td>
						<select name="position_id" id="position_id" class="form-control" msg="请选择职位" check="require">
							<option value="">选择职位</option>
							{:fill_option($position_list)}
						</select></td>
					</tr>
					<tr>
						<th>
						<nobr>
							办公室电话
						</nobr></th>
						<td>
						<input type="text" id="office_tel" name="office_tel" class="form-control">
						</td>
						<th>
						<nobr>
							移动电话
						</nobr></th>
						<td>
						<input type="text" id="mobile_tel" name="mobile_tel" class="form-control">
						</td>
					</tr>
					<tr>
					<tr>
						<th>电子邮箱</th>
						<td colspan="3">
						<input type="text" id="email" name="email" class="form-control">
						</td>
					</tr>
					<tr>
						<th>
						<nobr>
							负责业务
						</nobr></th>
						<td colspan="3">
						<input type="text" id="duty" name="duty" class="form-control">
						</td>
					</tr>
					<tr>
						<th>状态</th>
						<td colspan="3">
						<select class="form-control col-10"  name="is_del" id="is_del">
							<option  value="0">启用</option>
							<option value="1">禁用</option>
						</select></td>
					</tr>
				</table>
			</form>
		</div>
	</div>
</block>
<block name="js">
	<script type="text/javascript">
		function select_dept() {
			winopen("{:U('dept/winpop2')}", 730, 500);
		}

		function save() {
			if (check_form("form_data")) {
				var vars = $("#form_data").serialize();
				sendAjax("{:U('save')}", vars, function(data) {
					if (data.status) {
						ui_alert(data.info, function() {
							parent.location.reload(true);
							myclose();
						});
					}
				});
			}
		}
	</script>
</block>